﻿using System;
using System.Text;
using System.Windows.Forms;
using Me.Amon.M;
using Me.Amon.POS;
using Me.Amon.Uc;

namespace Me.Amon.WMS
{
    public partial class WWms : Form
    {
        private IViewModel _ViewModel;
        private XmlMenu<WWms> _XmlMenu;

        public WWms()
        {
            InitializeComponent();

            this.Icon = Me.Amon.Properties.Resources.Icon;
        }

        private void WWms_Load(object sender, EventArgs e)
        {
            _ViewModel = null;

            #region 系统选单
            _XmlMenu = new XmlMenu<WWms>(this, _ViewModel);
            if (_XmlMenu.Load("WMS.xml"))
            {
                _XmlMenu.GetMenuBar("WMS", MbMenu);
                _XmlMenu.GetToolBar("WMS", TbTool);
                _XmlMenu.GetStrokes("WMS", this);

                var buffer = new StringBuilder();
                foreach (var key in _XmlMenu.Strokes)
                {
                    buffer.Append('【').Append(key.Key).Append('】').Append(key.Memo).Append(' ');
                }
                SlHelp.Text = buffer.ToString();
            }
            #endregion

            TmTime.Start();

            //WebUtil.Server = Settings.Default.Server;
            //ShowDefault();
        }

        private void TmTime_Tick(object sender, EventArgs e)
        {
            var now = DateTime.Now;
            SlTime.Text = now.ToString(IEnv.FORMAT_DATE_TIME_WEEK);
        }
    }
}
